<div class="page-body">
    <div class="row">
        <div class="col-xs-12 col-md-12">
            <div class="widget">
                <div class="widget-header ">
                    <span class="widget-caption">书包列表</span>
                    <div class="widget-buttons">
                        <a href="#" data-toggle="maximize">
                            <i class="fa fa-expand"></i>
                        </a>
                        <a href="#" data-toggle="collapse">
                            <i class="fa fa-minus"></i>
                        </a>
                        <a href="#" data-toggle="dispose">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="widget-body">
                    <div class="table-toolbar">
                        <form method="get" action="{:U('index')}" class="form-inline" role="form">
                            <div class="form-group">
                                <span class="input-icon" style="width: 200px;">
                                    <input type="text" class="form-control input-sm" placeholder="书包编号"
                                           name="keywords" >
                                    <i class="glyphicon glyphicon-search blue"></i>
                                </span>
                                <span class="input-icon" style="width: 200px;">
                                    <input type="text" class="form-control input-sm" placeholder="学生名称"
                                           name="child_name" >
                                    <i class="glyphicon glyphicon-search blue"></i>
                                </span>

                                <button type="submit" class="btn btn-info">搜索</button>

                            </div>
                        </form>
                    </div>
                    <table class="table table-striped table-hover">
                        <thead>
                        <tr>
                            <th>
                                ID
                            </th>
                            <th>
                                书包名称
                            </th>
                            <th>
                                书包编号
                            </th>
                            <th>
                                学生名称
                            </th>
                            <th>
                                所属班级
                            </th>
                            <th>
                                所属幼儿园
                            </th>
                            <th>
                                操作
                            </th>
                        </tr>
                        </thead>

                        <tbody>
                        <foreach name="bagdata" item="v">
                            <tr>
                                <td>
                                    {$v.bag_id}
                                </td>
                                <td>
                                    {$v.bag_name}
                                </td>
                                <td>
                                    {$v.bag_card}
                                </td>
                                <td>
                                    {$v.nickname}
                                </td>
                                <td>
                                    {$v.class_name}
                                </td>
                                <td>
                                    {$v.name}
                                </td>
                                <td>
                                    <a class="btn btn-danger btn-xs"
                                       href="{:U('untie',array('bag_id'=>$v['bag_id']))}"><i
                                            class="fa fa-trash-o"></i>解绑</a>
                                    <a class="btn btn-info btn-xs"
                                       onclick="lock()" bag-id="{$v['bag_id']}"
                                    >
                                        <i class="fa fa-edit"></i> 锁定
                                    </a>
                                    <a class="btn btn-info btn-xs"
                                       href="{:U('booklist',array('bag_id'=>$v['bag_id']))}">
                                        <i class="fa fa-edit"></i> 查看图书
                                    </a>

                                </td>
                            </tr>
                        </foreach>
                        </tbody>
                    </table>
                    {$page}
                </div>
            </div>
        </div>
    </div>
</div>
<!--备注弹框-->
<div class="wrapper" style="width: 100%;
            height: 100%;
            background: rgba(0,0,0,.3);position:fixed;top:0px;margin-left: -13%;z-index: 99999;display: none">
    <div class="box" style="position: absolute;
            top: 50%;
            left: 50%;
            width: 200px;
            height: 100px;
            margin-top:-50px;
            margin-left: -100px;">
        <form action="{:U('lock')}" method="post">

            <input type="hidden" name="bag_id" />
            <textarea name="remark" placeholder="请输入备注" rows="6" cols="50" style="width: 400px;margin-left: -50%;
        " required></textarea>
            <button type="submit" style="display: block;
            width: 50%;
            margin: 10px auto;
            border: 0;
            background: green;
            color: #fff;
            cursor: pointer;
            border-radius: 10px;
            padding: 5px 0;">
                确定
            </button>
            <button onclick="closeBox()" style="display: block;
            width: 50%;
            margin: 10px auto;
            border: 0;
            background: #5f646e;
            color: #fff;
            cursor: pointer;
            border-radius: 10px;
            padding: 5px 0;">
                取消
            </button>
        </form>
    </div>

</div>
<script>
    function lock(){
        $('.wrapper').css('display','block');
        var bag_id = $(this).attr('bag-id');
        $('input[name=bag_id]').val(bag_id);
    }
    function closeBox(){
        $('.wrapper').css('display','none');
    }
</script>